<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>Document</title>
</head>
<body>
	<div class="tab" id="tab">
    <input class="active" type="button" value="第一天" />
    <input type="button" value="第二天" />
    <input type="button" value="第三天" />
    <div style="display:block;">list1</div>
    <div>list2</div>
    <div>list3</div>
</div>
</body>
<script type="text/javascript">
	window.onload = function() {
	var oTab = new Tabs("tab");
}
function Tabs(id) {
	var oDiv = document.getElementById(id);
	this.aBtn = oDiv.getElementsByTagName('input');
	this.aDiv = oDiv.getElementsByTagName('div');
	var i = 0;
	var _this = this; 
	for(i = 0; i < this.aBtn.length; i++) {
		this.aBtn[i].index = i;
		this.aBtn[i].onclick = function() {
			_this.tab(this); 
		};
	}
};
Tabs.prototype.tab = function(oBtn) {
	for(i = 0; i < this.aBtn.length; i++) {
		this.aBtn[i].className = '';
		this.aDiv[i].style.display = 'none';
	}
	oBtn.className = 'active'; 
	this.aDiv[oBtn.index].style.display = 'block';
}
</script>
</html>